#include "LOK2ChatMessageHandler.h"

LOK2ChatMessageHandler::LOK2ChatMessageHandler(LOK2ChatDisplay *pDisplay) {
	if(pDisplay) m_pDisp = pDisplay;
	else m_pDisp = NULL;
}

bool LOK2ChatMessageHandler::send(LOK2ChatPacket msg) {
	std::vector < std::pair < int, std::string > > sendBuffer;
	if(!msg.command) {
		sendBuffer.push_back(make_pair(LOK2CHATCMSG, msg.username));
		sendBuffer.push_back(make_pair(LOK2CHATBMSG, msg.message));
		m_pDisp->addLine(sendBuffer);
		return true;
	}
	return false;
}

void LOK2ChatMessageHandler::recv(LOK2ChatPacket msg) { }

